package megamek.unit.tests;

import org.junit.*;
import megamek.common.IGame;
import megamek.common.Aero;
import megamek.common.Board;
import megamek.common.Targetable;
import megamek.common.Coords;
import megamek.common.ToHitData;
import megamek.common.Game;
import megamek.common.IBoard;
import megamek.common.Entity;
import megamek.common.MovePath;
import megamek.common.Building;
import static org.junit.Assert.*;

/**
 * The class <code>ChargeAttackActionTest</code> contains tests for the class <code>{@link ChargeAttackAction}</code>.
 *
 * @generatedBy CodePro at 5/20/14 12:34 AM
 * @author Wraith
 * @version $Revision: 1.0 $
 */
public class ChargeAttackActionTest {
	/**
	 * Run the ChargeAttackAction(Entity,Targetable) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testChargeAttackAction_1()
		throws Exception {
		Entity attacker = new Aero();
		Targetable target = new Aero();

		ChargeAttackAction result = new ChargeAttackAction(attacker, target);

		// add additional test code here
		assertNotNull(result);
		assertEquals(null, result.getTargetPos());
		assertEquals(-1, result.getTargetId());
		assertEquals(0, result.getTargetType());
		assertEquals(-1, result.getEntityId());
	}

	/**
	 * Run the ChargeAttackAction(int,int,int,Coords) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testChargeAttackAction_2()
		throws Exception {
		int entityId = 1;
		int targetType = 1;
		int targetId = 1;
		Coords targetPos = new Coords();

		ChargeAttackAction result = new ChargeAttackAction(entityId, targetType, targetId, targetPos);

		// add additional test code here
		assertNotNull(result);
		assertEquals(1, result.getTargetId());
		assertEquals(1, result.getTargetType());
		assertEquals(1, result.getEntityId());
	}

	/**
	 * Run the int getDamageFor(Entity) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_1()
		throws Exception {
		Aero entity = new Aero();
		entity.delta_distance = 1;

		int result = ChargeAttackAction.getDamageFor(entity);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,boolean,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_2()
		throws Exception {
		Entity entity = new Aero();
		boolean tacops = true;
		int hexesMoved = 1;

		int result = ChargeAttackAction.getDamageFor(entity, tacops, hexesMoved);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Entity,boolean,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_3()
		throws Exception {
		Aero entity = new Aero();
		entity.delta_distance = 1;
		Entity target = new Aero();
		boolean tacops = true;
		int mos = 1;

		int result = ChargeAttackAction.getDamageFor(entity, target, tacops, mos);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Entity,boolean,int,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_4()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = false;
		int mos = 1;
		int hexesMoved = 0;

		int result = ChargeAttackAction.getDamageFor(entity, target, tacops, mos, hexesMoved);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Entity,boolean,int,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_5()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = false;
		int mos = 1;
		int hexesMoved = 1;

		int result = ChargeAttackAction.getDamageFor(entity, target, tacops, mos, hexesMoved);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Entity,boolean,int,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageFor_6()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = true;
		int mos = 1;
		int hexesMoved = 1;

		int result = ChargeAttackAction.getDamageFor(entity, target, tacops, mos, hexesMoved);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Entity) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_1()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();

		int result = ChargeAttackAction.getDamageTakenBy(entity, target);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Building,Coords) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_2()
		throws Exception {
		Entity entity = new Aero();
		Building bldg = new Building(new Coords(), new Board(), 1);
		Coords coords = new Coords();

		int result = ChargeAttackAction.getDamageTakenBy(entity, bldg, coords);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.Building.<init>(Building.java:194)
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Entity,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_3()
		throws Exception {
		Aero entity = new Aero();
		entity.delta_distance = 1;
		Entity target = new Aero();
		boolean tacops = true;

		int result = ChargeAttackAction.getDamageTakenBy(entity, target, tacops);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Entity,boolean,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_4()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = false;
		int distance = 1;

		int result = ChargeAttackAction.getDamageTakenBy(entity, target, tacops, distance);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Entity,boolean,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_5()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = false;
		int distance = 1;

		int result = ChargeAttackAction.getDamageTakenBy(entity, target, tacops, distance);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageTakenBy(Entity,Entity,boolean,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testGetDamageTakenBy_6()
		throws Exception {
		Entity entity = new Aero();
		Entity target = new Aero();
		boolean tacops = true;
		int distance = 1;

		int result = ChargeAttackAction.getDamageTakenBy(entity, target, tacops, distance);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the ToHitData toHit(IGame) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_1()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();

		ToHitData result = fixture.toHit(game);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:89)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:77)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_2()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_3()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_4()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_5()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_6()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_7()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_8()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_9()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_10()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_11()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,MovePath) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_12()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		MovePath moveD = new MovePath(new Game(), new Aero());

		ToHitData result = fixture.toHit(game, moveD);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.AbstractAttackAction.getTarget(AbstractAttackAction.java:97)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:373)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Test
	public void testToHit_13()
		throws Exception {
		ChargeAttackAction fixture = new ChargeAttackAction(1, 1, 1, new Coords());
		IGame game = new Game();
		boolean skid = true;

		ToHitData result = fixture.toHit(game, skid);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.ChargeAttackAction.toHit(ChargeAttackAction.java:89)
		assertNotNull(result);
	}

	/**
	 * Perform pre-test initialization.
	 *
	 * @throws Exception
	 *         if the initialization fails for some reason
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@Before
	public void setUp()
		throws Exception {
		// add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 *
	 * @throws Exception
	 *         if the clean-up fails for some reason
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	@After
	public void tearDown()
		throws Exception {
		// Add additional tear down code here
	}

	/**
	 * Launch the test.
	 *
	 * @param args the command line arguments
	 *
	 * @generatedBy CodePro at 5/20/14 12:34 AM
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(ChargeAttackActionTest.class);
	}
}